#include <iostream>

using namespace std;

void sushu(int num);

int main(void)
{
	int num;

	cout << "num: ";
	cin >> num;

	sushu(num);

	return 0;
}

void sushu(int num)
{
	int i;
	int pan, duan;
	int sum = 0;
	for(i = 2; i <= num; i ++)
	{
		for(pan = 2; pan <= i / 2; pan ++)
		{
			duan = i % pan;
			if(duan == 0)
				break;	
		}
		if(duan != 0)
		{
			cout << i << endl;
			sum ++;
		}
	}
	cout << sum << endl;
}
